<%@ include file="/en/jsp/static.jsp" %>
<%@ page import="java.util.*,linuxbox.reservation.logic.*,linuxbox.resource.logic.*" %>
<%
  String NAME = (String) request.getAttribute("NAME");
  String DESCRIPTION = (String) request.getAttribute("DESCRIPTION");
  int ID = Integer.parseInt((String)request.getAttribute("ID"));
%>

<jsp:include page="/en/jsp/header.jsp" flush="true"/>

<form action="<%=BoxStatic.servletDir%>BoxResourceCatAction" method=post>
<table width="100%" height=26 align=middle border=0 cellpadding=0 cellspacing=0 bgcolor="#f4f4f4" style="font-size:16px;color:#d05000">
  <tr>
    <td>
      &nbsp;<img src="<%=BoxStatic.imageDir%>itemball.jpg" width=14 height=15 border=0 align="absmiddle">
      <b><%=boxName%> - Resource Category Add/Edit</b>
    </td>
    <td align=right>
      <a href="<%=BoxStatic.jspDir%>resource/BoxResourceCat.jsp">
        Resource Category List
      </a>
    </td>
  </tr>
</table>

<hr width="100%" color=#E06000 align=left>

<input type=hidden name=ID value=<%=ID%>>

<table width= "100%" border=1 cellspacing=0 cellpadding=1>
  <tr><td>
    <table border=0 width="100%" bgcolor=#e0e0e0 style="font-size:14px">
      <tr><td>
        <b>Name:</b> <input align=right type=text name=NAME size=50 value="<%=NAME%>">
      </td></tr>
      <tr><td>
        <b>Description:</b><br>
        <textarea name=DESCRIPTION rows=5 cols=60><%=DESCRIPTION%></textarea><br>
      </td></tr>
      <tr><td>
        <input type=submit value=
    <%
      if (ID==0)
        out.println("\"Add\" name=SubmitSave>");
      else
      {
        out.println("\"Update\" name=SubmitUpdate>");
        BoxResource resource = BoxResource.getInstance();
        if (resource.getResourceCountByCat(ID)==0)
          out.println("<input type=submit value=\"Delete\" name=SubmitDelete>");
      }
    %>
            <input type=submit value="Cancel" name=SubmitCancel>
      </td></tr>
    </table>
  </td></tr>
</table>

<hr width="100%" color=#E06000 align=left>
</form>

<jsp:include page="/en/jsp/footer.jsp" flush="true"/>
